package com.ie.cloud.payment.utils;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;

/**
 * Created with FR
 *
 * @Author: DQ
 * @Date: 2025/07/17/14:27
 * @Description: 描述语句
 */
public class IdUtils {


    public static final Snowflake SNOWFLAKE = IdUtil.getSnowflake(1,10);


    public static String getId(int length){
        return SNOWFLAKE.nextIdStr().subSequence(0,length).toString();
    }

    public static Long getId(){
        return SNOWFLAKE.nextId();
    }


    public static String getId(String  prefix){
        return prefix + SNOWFLAKE.nextIdStr();
    }


}
